<template>
    <div>
      <el-table :data="recordList" style="...">
        <el-table-column prop="id" label="编号"></el-table-column>
        <el-table-column prop="name" label="奖惩"></el-table-column>
        <el-table-column label="学生">
<!--          自定义列模板通过route来获取--><template>
            {{$route.query.stuName}}
          </template>
        </el-table-column>
        <el-table-column prop="des" label="描述"></el-table-column>
        <el-table-column prop="createBy" label="创建人"></el-table-column>
      </el-table>
    </div>
</template>

<script>
export default {
  name: "stu_rec",
    data(){
        return{
          recordList:[]
        }
    },
    watch:{//可以监听变量的编号 变量变，动态获取手台数据
      //to from 从哪来 到哪去
      $route(){
        this.axios.get("/record/selects/"+this.$route.query.stuId).then((resp)=>{
          this.recordList=resp.data
        });
      }
  }
}
</script>

<style scoped>

</style>
